# encoding=utf-8
# coder : chenfeng@xyzq.com.cn
# date  : 2014-1-6

import json

class AjaxResponse:
	'''
		Description : For ajax response message.
	'''
	success = True
	errInfo = ''
	data = {}
	
	def __init__(self, success=True, errInfo='', data = None) :
		if data is None:
			self.data = {}
		else :
			self.data = data
		
		self.success = success
		self.errInfo = errInfo

	def toJsonStr(self):
		jsondict = {'success': self.success, 'errInfo' : self.errInfo, 'data': self.data }
		return json.dumps(jsondict)
